import React from "react";

export interface UserInfo {
    userNo: string;
    userName: string;
    nickname: string;
    realName: string;
    email: string;
    phone: string;
}

/**
 * 基础请求
 */
export interface BaseReq {
    apiUrl:string,
    method:"POST" | "GET" | string,
    reqData?: BaseReqData,
}

/**
 * 基础请求数据
 */
export interface BaseReqData {
    headers: Record<string, string>;
    body: Record<string, unknown>;
}
export interface BaseRespData<T> {
    success: boolean,
    errorCode?: string,
    errorMsg?: string,
    requestId: string,
    data: Record<string, T>,
}

/**
 * 平台请求
 */
export interface PlatReq extends Record<string, unknown>{
    interfaceName: string,
    requestId?: string,
    reqData: Record<string, unknown>,
}

export interface RedirectDifyReq extends Record<string, unknown>{
    difyUrl:string,
    method: "POST" | "GET" | "DELETE" | string,
    difyReqBody?: Record<string, unknown>,
    difyReqParam?: Record<string, string|number>,
    //默认提取的返回字段名，不指定将返回外层包装的对象
    defaultResDataField?: string
}

export interface UserResp extends Record<string, unknown>{
    token:string,
    userBean:UserInfo,
    expire:number
}
//>>>>>>>>>>>>>>>>>>>>>>>>以下位bubble相关的>>>>>>>>>>>>>>>>
export enum OpType {
    copy,like,dislike,read
}
export interface BubbleContent {
    key?:string,
    role:string,
    msgId: string,
    msg: string,
    opTypes?: OpType[]
    files?: FileContent[],
}
export interface FileContent {
    fileId: string,
    name: string,
    size?: number,
    description?: string,
}
export interface BubbleItem {
    key: string,
    role: "ai"| "local" | "localFile" | string,
    content?: BubbleContent | React.ReactNode | object,
}